#include <stdio.h>

int max(int a, int b)
{
    if (a > b)
        return a;

    return b;
}

int main(int argc, char **argv)
{
    printf("%x\n", max(0x666, 0x777));
    printf("%x\n", max(0x666, argc));
    printf("%x\n", max(0x666, argc));

    return 0;
}

#if 0
/*
 * intel
 */
0000000000001149 <max>:
    1149:	f3 0f 1e fa          	endbr64 
    114d:	55                   	push   %rbp
    114e:	48 89 e5             	mov    %rsp,%rbp
    1151:	89 7d fc             	mov    %edi,-0x4(%rbp)
    1154:	89 75 f8             	mov    %esi,-0x8(%rbp)
    1157:	8b 45 fc             	mov    -0x4(%rbp),%eax
    115a:	3b 45 f8             	cmp    -0x8(%rbp),%eax
    115d:	7e 05                	jle    1164 <max+0x1b>
    115f:	8b 45 fc             	mov    -0x4(%rbp),%eax
    1162:	eb 03                	jmp    1167 <max+0x1e>
    1164:	8b 45 f8             	mov    -0x8(%rbp),%eax
    1167:	5d                   	pop    %rbp
    1168:	c3                   	retq   

0000000000001169 <main>:
    1169:	f3 0f 1e fa          	endbr64 
    116d:	55                   	push   %rbp
    116e:	48 89 e5             	mov    %rsp,%rbp
    1171:	48 83 ec 10          	sub    $0x10,%rsp
    1175:	89 7d fc             	mov    %edi,-0x4(%rbp)
    1178:	48 89 75 f0          	mov    %rsi,-0x10(%rbp)
    117c:	be 77 07 00 00       	mov    $0x777,%esi
    1181:	bf 66 06 00 00       	mov    $0x666,%edi
    1186:	e8 be ff ff ff       	callq  1149 <max>
    118b:	89 c6                	mov    %eax,%esi
    118d:	48 8d 3d 70 0e 00 00 	lea    0xe70(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    1194:	b8 00 00 00 00       	mov    $0x0,%eax
    1199:	e8 b2 fe ff ff       	callq  1050 <printf@plt>
    119e:	8b 45 fc             	mov    -0x4(%rbp),%eax
    11a1:	89 c6                	mov    %eax,%esi
    11a3:	bf 66 06 00 00       	mov    $0x666,%edi
    11a8:	e8 9c ff ff ff       	callq  1149 <max>
    11ad:	89 c6                	mov    %eax,%esi
    11af:	48 8d 3d 4e 0e 00 00 	lea    0xe4e(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    11b6:	b8 00 00 00 00       	mov    $0x0,%eax
    11bb:	e8 90 fe ff ff       	callq  1050 <printf@plt>
    11c0:	8b 45 fc             	mov    -0x4(%rbp),%eax
    11c3:	89 c6                	mov    %eax,%esi
    11c5:	bf 66 06 00 00       	mov    $0x666,%edi
    11ca:	e8 7a ff ff ff       	callq  1149 <max>
    11cf:	89 c6                	mov    %eax,%esi
    11d1:	48 8d 3d 2c 0e 00 00 	lea    0xe2c(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    11d8:	b8 00 00 00 00       	mov    $0x0,%eax
    11dd:	e8 6e fe ff ff       	callq  1050 <printf@plt>
    11e2:	b8 00 00 00 00       	mov    $0x0,%eax
    11e7:	c9                   	leaveq 
    11e8:	c3                   	retq   
    11e9:	0f 1f 80 00 00 00 00 	nopl   0x0(%rax)

/*
 * arm
 */
000000000040055c <max>:
  40055c:	d10043ff 	sub	sp, sp, #0x10
  400560:	b9000fe0 	str	w0, [sp, #12]
  400564:	b9000be1 	str	w1, [sp, #8]
  400568:	b9400fe1 	ldr	w1, [sp, #12]
  40056c:	b9400be0 	ldr	w0, [sp, #8]
  400570:	6b00003f 	cmp	w1, w0
  400574:	5400006d 	b.le	400580 <max+0x24>
  400578:	b9400fe0 	ldr	w0, [sp, #12]
  40057c:	14000002 	b	400584 <max+0x28>
  400580:	b9400be0 	ldr	w0, [sp, #8]
  400584:	910043ff 	add	sp, sp, #0x10
  400588:	d65f03c0 	ret

000000000040058c <main>:
  40058c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400590:	910003fd 	mov	x29, sp
  400594:	b9001fa0 	str	w0, [x29, #28]
  400598:	f9000ba1 	str	x1, [x29, #16]
  40059c:	5280eee1 	mov	w1, #0x777                 	// #1911
  4005a0:	5280ccc0 	mov	w0, #0x666                 	// #1638
  4005a4:	97ffffee 	bl	40055c <max>
  4005a8:	2a0003e1 	mov	w1, w0
  4005ac:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  4005b0:	911ac000 	add	x0, x0, #0x6b0
  4005b4:	97ffffa7 	bl	400450 <printf@plt>
  4005b8:	b9401fa1 	ldr	w1, [x29, #28]
  4005bc:	5280ccc0 	mov	w0, #0x666                 	// #1638
  4005c0:	97ffffe7 	bl	40055c <max>
  4005c4:	2a0003e1 	mov	w1, w0
  4005c8:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  4005cc:	911ac000 	add	x0, x0, #0x6b0
  4005d0:	97ffffa0 	bl	400450 <printf@plt>
  4005d4:	b9401fa1 	ldr	w1, [x29, #28]
  4005d8:	5280ccc0 	mov	w0, #0x666                 	// #1638
  4005dc:	97ffffe0 	bl	40055c <max>
  4005e0:	2a0003e1 	mov	w1, w0
  4005e4:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  4005e8:	911ac000 	add	x0, x0, #0x6b0
  4005ec:	97ffff99 	bl	400450 <printf@plt>
  4005f0:	52800000 	mov	w0, #0x0                   	// #0
  4005f4:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4005f8:	d65f03c0 	ret
  4005fc:	00000000 	.inst	0x00000000 ; undefined


#endif